import Vue from 'vue'
import App from './App.vue'
import router from "@/router"
import NavType from "@comp/NavType"
import Swiper from "@comp/Swiper"
import store from "@/store"
import Pagenation from "@comp/Pagenation"



Vue.config.productionTip = false
//全局注册组件，导航组件在home页
Vue.component("NavType",NavType)
//全局注册轮播图的组件
Vue.component("Swiper",Swiper)
//全局注册页码组件
Vue.component("Pagenation",Pagenation)

// import { request } from './utils/http'

//把mock引入项目 让mockServer执行
import "@/mock/mockServer";

new Vue({
  render: h => h(App),
  //把router路由对象注册到实例上，那么所有的组件实例上都有有一个$router和$route对象
  router,
  store,
  //事件总线给vue的原型对象上绑定一个属性，值为vm实例，用来将输入框的value清空
  beforeCreate(){
    Vue.prototype.$bus = this
  }
}).$mount('#app')

// //配置代理服务器之后，将baseUrL设置为/ 测试配置代理后请求是否成功
// const getresult =async()=>{
//  const re = await request.get("/api/product/getBaseCategoryList")
//  console.log(re)
// }
// getresult()